package com.chat.openfeign.client;

import com.chat.common.dto.GetGroupDTO;
import com.chat.common.entity.Group;
import com.chat.common.form.ListForm;
import com.chat.common.vo.GetGroupVO;
import com.chat.common.vo.GroupVO;
import com.chat.common.vo.R;
import com.chat.openfeign.client.fallback.BusinessDataServiceFallback;
import jakarta.validation.constraints.NotBlank;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author wei kunJie
 * @date 2024/4/8 13:49:40
 */
@FeignClient(value = "chat-business-data-service",
        fallback = BusinessDataServiceFallback.class)
public interface BusinessDataService {
    @GetMapping(value = "/business/test")
    R test();

    @GetMapping(value = "/business/channel/group/getUserGroups")
    R<List<GroupVO>> getUserGroups(@RequestParam("userId") Long userId);

    @PostMapping("/business/channel/group/getUserGroups")
    R<ListForm<GetGroupVO>> getAllGroups(GetGroupDTO getGroupDTO);

    @GetMapping("/business/channel/group/disableGroup")
    R DisableGroup(@RequestParam("groupId") String ID);

    @GetMapping("/business/channel/group/enableGroup")
    R EnableGroup(@RequestParam("groupId") String ID);

    @GetMapping("/business/user/offline")
    R offline(String ID);

    @GetMapping("/business/channel/group/group_account")
    R<Group> getGroupByAccount(@RequestParam("groupAccount") String groupAccount);
}
